<?php

namespace app\api\controller;

use app\model\DistrictModel;
use think\App;

class District extends Base {

    private $districtModel;

    private $req;

    private $pid;


    public function __construct(App $app){

        parent::__construct($app);

        $this->req = request()->param();

        $this->pid = isset($this->req["pid"]) ? $this->req["pid"] : 0;

        $this->districtModel = new DistrictModel();

    }


    /*
     * 获取用户信息
     * */
    public function getList(){

        $where[] = ["pid","=",$this->pid];

        $list = $this->districtModel->getList($where);

        $total = $this->districtModel->getTotal($where);

        return $this->succData($total,$list);

    }



}